package com.zyg.supplier;

import java.util.function.Supplier;

public class MySupplierDemo {
    public static void main(String[] args) {
        int[] arr = {110, 20, 50, -10, 30};
        Integer result = getMin(() -> {
            int min = arr[0];
            for (int i : arr) {
                if (i < min) {
                    min = i;
                }
            }
            return min;
        });
        System.out.println(result);

    }

    public static Integer getMin(Supplier<Integer> supplier) {
        return supplier.get();
    }
}
